<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {
            list-style: none;
            display: flex;
        }

        li {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 1px solid;
            text-align: center;
            line-height: 50px;
            color: #fff;
        }
    </style>
</head>

<body>
    <!-- 中奖 -->
    <ul class="luckyUl"></ul>
    <!-- 机选 -->
    <ul class="computerUl"></ul>

    <h3 id="result"></h3>

    <script src="../tools.js"></script>
    <script>
        let luckyUl = document.querySelector('.luckyUl'); // 中奖
        let computerUl = document.querySelector('.computerUl'); // 机选 

        function create() {
            let s = new Set();
            while (s.size < 6) {
                let number = random(1, 33);
                s.add(number);
            }
            let arr = [...s].sort((a, b) => a - b);
            let number = random(1, 16);
            return [arr, number];
        }
        let [luckyArr, luckyNumber] = create();
        let [computerArr, computerNumber] = create();

        luckyUl.innerHTML = luckyArr.map(item => `<li style='background:red;'>${item}</li>`).join('');
        luckyUl.innerHTML += `<li style='background:blue;'>${luckyNumber}</li>`;

        computerUl.innerHTML = computerArr.map(item => `<li style='background:red;'>${item}</li>`).join('');
        computerUl.innerHTML += `<li style='background:blue;'>${computerNumber}</li>`;


        result.innerText = '5块钱';

    </script>
</body>

</html>